<?php 

$countries = array(	'eastRussia',
					'nepal',
					'northKorea',
					'southKorea',
					'japan',
					'taiwan',
					'philippines',
					'indonesia',
					'vietnam',
					'sriLanka',
					'india',
					'jammuAndKashmir',
					'bhutan',
					'bangladesh',
					'thailand',
					'malaysia',
					'cambodia',
					'burma',
					'laos',
					'china',
					'mongolia',
					'eastKazakhstan',
					'yemen',
					'cyprus',
					'oman',
					'unitedArabEmirates',
					'kuwait',
					'saudiArabia',
					'kyrgyzstan',
					'uzbekistan',
					'tajikistan',
					'pakistan',
					'afghanistan',
					'turkmenistan',
					'iran',
					'iraq',
					'nakhchivan',
					'armenia',
					'azerbaijan',
					'georgia',
					'gazaStrip',
					'westBank',
					'syria',
					'israel',
					'lebanon',
					'jordan',
					'eastTurkey'
					);


$__contents = 'package org.dschini.data.ui.maps.world.##Continent## {
	
	import org.dschini.utils.*;
	import org.dschini.data.ui.maps.*;
	import org.dschini.data.ui.maps.world.##Continent##.*;
	
	public class ##Country##MapData extends MapData
	{
		public function ##Country##MapData():void
		{
			_title = "<undefined>";
			backgroundVisible = false;
			stateLinesVisible = false;
			shapeVisible = true;
			locationData = new ExtendedArray();
		}
		
		override public function set lang( lang:String ):void
		{
			_lang = lang;
			switch( _lang ){
				case "en":
					_title = "##Country##";
					break;
				case "de":
					_title = "##Country##";
					break;
			}
			for(var i:int=0; i<locationData.length; i++){
				MapLocationData(locationData[i]).lang = lang;
			}
		}
	}
}';

$Continent = "asia";

foreach( $countries as $country ){
	$FileName = ucfirst($country).'MapData.as';

	if( file_exists( $FileName ) == false ){
		$fp = fopen($FileName, 'w');
		
		$healthy = array("##Continent##", "##Country##", "##CountryToLower##");
		$yummy = array($Continent,ucfirst($country),$country);
		$Contents = str_replace($healthy, $yummy, $__contents);
		
		fwrite($fp, $Contents);
		fclose($fp);
	}

}
